<?php


namespace App\Http\Requests\Platform;

use App\Http\Requests\BaseRequest;

class AdminRequest extends BaseRequest
{
    public $scenes=[
        'add'=>['account','name','password'],
        'edit'=>['id','account','name','password'],
        'login'=>['account','password'],
    ];

    public function rules()
    {
        return [
            'id' => 'required|integer',
            'account' => 'required|between:5,12',
            'name' => 'required|between:2,10',
            'password' => 'required|between:6,12',
        ];
    }

    public function messages()
    {
        return [
            'id.required' => 'id不能为空',
            'id.integer' => 'id必须为整数',
            'account.required' => '管理员账号不能为空',
            'account.between' => '账号长度再5到12之间',
            'name.required' => '姓名必须填写',
            'name.between' => '姓名长度须在2到12之间',
            'password.required' => '缺少密码',
            'password.between' => '密码长度在6到12之间',
        ];
    }






}
